/*
 * Copyright GTEAM.,LTD.
 * All rights reserved.
 * 
 * This software is the confidential and proprietary information
 * of yysvip.tistory.com.,LTD. ("Confidential Information").
 */
package egovframework.com.util; 

import org.apache.log4j.Logger;

/**
 * <pre>
 * egovframework.com.util 
 *    └ Util.java
 * 
 * </pre>
 * @date : 2014. 10. 7. 오후 8:46:53
 * @author : us
 * @history : 
 *	-----------------------------------------------------------------------
 *	변경일				작성자						변경내용  
 *	----------- ------------------- ---------------------------------------
 *	2014. 10. 7.		us				최초 작성 
 *	-----------------------------------------------------------------------
 * 
 */
public class Util {

	private Logger log = Logger.getLogger(this.getClass());
	
	/**문자열 : null 값변환*/
	public String doNull(String val) throws Exception {
		String rtnVal = "";
		if (val != null) rtnVal = val;
		return rtnVal;
	}

	/**문자열 : null 값 대체*/
	public String doNull(String val, String txt) throws Exception {
		String rtnVal = txt;
		if (!doNull(val).trim().equals("")) rtnVal = val;
		return rtnVal;
	}

	/**숫자형 대체*/
	public int doInt(int val, int num) throws Exception {
		int rtnVal = num;
		if (val > 0) rtnVal = val;
		return rtnVal;
	}
	
	/**숫자형 > 0 체크*/
	public boolean chkZero(int val) throws Exception {
		if(val > 0 || val < 0) return false;
		else return true;
	}
	
	/**숫자형 Null체크*/
	public boolean chkInt(int val) throws Exception {
		if(this.doNull(Integer.toString(val)).equals("")) return true;
		else return false;
	}
}
